#include<iostream>
using namespace std;
bool test(int n) {
	int flag = 1;
	while (n) {
		int now = n % 10;
		n /= 10;
		if ((flag && now % 2)||(!flag && now % 2 == 0))
			flag = 1 - flag;
		else
			return false;
	}
	return true;
}
int main() {
	int n,ans=0;
	cin >> n;
	for (int i = 1; i <= n; ++i) {
		if (test(i))
			++ans;
	}
	cout << ans;
	return 0;
}